package com.cn.yugan.Engine.Json;

import com.cn.yugan.Engine.Beans.ArticleListInfo;
import com.cn.yugan.Engine.Beans.UpInfo;
import com.cn.yugan.Engine.Beans.UserInfo;
import com.cn.yugan.Utils.GsonUtils;
import com.cn.yugan.Utils.LogUtils;
import com.cn.yugan.Utils.ToastUtils;
import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Map;

/**
 * Created by Rover on 2016/12/15 .
 * Email 357319517@qq.com
 */
public class UpInfoJson {

    public static UpInfo json2list(byte[] bytes, String uid) {
        try {
            UpInfoJsonObj upInfo = GsonUtils.GsonToBean(new String(bytes, "utf-8"), UpInfoJsonObj.class);
            if (upInfo.isSuccess()) {
                return upInfo.getData();
            } else {
                return null;
            }
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }
}

